feat: AMD SEV-SNP app key provisioning (GetAppKeyAmd)#630
Open
DeDTihoN wants to merge 8 commits intoDstack-TEE:masterfrom
Open
feat: AMD SEV-SNP app key provisioning (GetAppKeyAmd)#630DeDTihoN wants to merge 8 commits intoDstack-TEE:masterfrom
DeDTihoN wants to merge 8 commits intoDstack-TEE:masterfrom
Conversation
Collaborator
|
Thanks for the PR. I still need to review the details, but one high‑level concern: it’s not clear how this integrates with the existing dstack-os images, and for SEV-SNP the way we build the OS image and launch the CVM is part of the security model. Could you provide the scripts of how the SEV-SNP OS image is built and the CVM is launched? Also, in what environment do you expect this CVM to run (e.g. GCP, bare metal)? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: AMD SEV-SNP app key provisioning (
GetAppKeyAmd)Adds AMD SEV-SNP support to the KMS. AMD-based confidential VMs can now obtain the same application keys (disk encryption, env secrets, k256 identity) as Intel TDX VMs.
How it differs from
GetAppKey(TDX)GetAppKey)GetAppKeyAmd)MEASUREMENTfixed at launch: OVMF + kernel + initrd + cmdlineMEASUREMENT; KMS recomputes expected value and rejects any mismatchos_image_hash+compose_hashos_image_hash+compose_hashreport_dataAMD SEV-SNP supports generating on-demand attestation reports with custom
report_data(via/dev/sev-guest), so RA-TLS over mTLS would be technically feasible. However, implementing it would require changes at multiple levels: AMD-specific X.509 extension format, a new code path inhandle_prpc_implto parse two different attestation types from client certs, and a new cert generation flow parallel to the existing TDX one. Instead, the current approach sends the SNP report in the request body and ECDH-encrypts the response to the VM's X25519 pubkey embedded inreport_data[0..32]. The VM places its pubkey there before requesting the report from the kernel, so AMD hardware attests it. This is simpler to implement and equivalent in security.Changes
kms/src/main_service.rsget_app_key_amd: verifies AMD cert chain (ARK → ASK → VCEK → SNP report), recomputes expectedMEASUREMENT, calls auth webhook, derives keys, ECDH-encrypts responsekms/rpc/proto/kms_rpc.protoGetAppKeyAmdRPC,GetAppKeyAmdRequest,AppKeyAmdResponsekms/src/config.rs,kms/kms.toml[core.sev_snp]section (ovmf_path,guest_features); if absent, measurement recomputation is skippeddstack-attest/DstackSevSnpattestation mode variant